//
//  Emoticon.swift
//  emotIcon
//
//  Created by 半缘君 on 15/12/15.
//  Copyright © 2015年 banyuanjun.cn. All rights reserved.
//

import UIKit

class Emoticon: NSObject {
    ///传递给服务器的字符串
    var chs:String?
    /// 本地图片的名字
    var png:String?
    /// 表情字符
    var code:String?{
        didSet {
            emoji = code?.emoji
        }
    }
    
    var emoji:String?
    
    /// 图片全路径
    var imagePath: String? {
        // 判断是否有图片
        if png == nil {
            return nil
        }
        // 拼接完整路径
        return NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
    }
    /// 是不是删除键
    var isRemoved = false
    
    var isEmpty = false
    
    init(isEmpty:Bool) {
        super.init()
        if !isEmpty{
            return
        }
        self.isEmpty = isEmpty
        
        
    }
    
    init(isRemoved:Bool) {
        super.init()
        if !isRemoved{
            return
        }
        self.isRemoved = isRemoved
    }
    
    init(dict:[String:AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
        
    }
    override var description:String{
        
        return printClass(self.classForCoder)
    }
}
